package com.huanghuang.shuadan.common.exception.base;

import com.huanghuang.shuadan.common.exception.ExceptionEnum;

/**
 * @Author suxiaoxiao
 * @Date 2019/7/13 22:27
 * @Version 1.0
 */
public class BaseException extends RuntimeException {

    /**
     * 错误码
     */
    private String code;

    /**
     * 错误信息
     */
    private String message;

    public BaseException(ExceptionEnum exceptionEnum) {
        super(exceptionEnum.getMessage());
        this.code = exceptionEnum.getCode();
        this.message = exceptionEnum.getMessage();
    }

    public BaseException(String code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

}
